﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;

namespace PTTK_HTTT_06.DAO
{
    class CT_DON_DAT_HANG_DB
    {
        internal static void ThemCTDonDatHang(BUS.CT_DON_DAT_HANG _nguyenLieu)
        {
            DataProvider _provider = new DataProvider();
            _provider.Connect();
            SqlParameter[] _para =
            {
                new SqlParameter("@MaDonDatHang",SqlDbType.Int){Value = _nguyenLieu.MaDonDatHang.ToString()},
                new SqlParameter("@MaNguyenLieu",SqlDbType.Int){Value = _nguyenLieu.MaNguyenLieu},
                new SqlParameter("@MaNhaCungCap",SqlDbType.Int){Value = _nguyenLieu.MaNhaCungCap},
                new SqlParameter("@SoLuong",SqlDbType.Int){Value = _nguyenLieu.SoLuong},
                new SqlParameter("@GiaNhap",SqlDbType.Money){Value = _nguyenLieu.GiaNhap}                
            };
            _provider.ExcuteProcedure("usp_ThemChiTietDonDatHang", _para);
            _provider.Disconnect();
        }
    }
}
